mod sse;
use axum::{Router, response::{Html, IntoResponse}, routing::get};

use crate::sse::sse_handler;


const INDEX_HTML: &str = include_str!("../index.html");


pub fn get_router() -> Router {
    Router::new()
    .route("/", get(index_handler))
    .route("/events", get(sse_handler))  // 函数的参数不用传， 那是如何接收的呢？ 老师的是会报错  #[debug_handler]
}

async fn index_handler() -> impl IntoResponse {
    Html(INDEX_HTML)
}